# coding:utf8

import MySQLdb

# 获取连接
conn = MySQLdb.connect(
                       host='127.0.0.1',
                       user='root',
                       passwd='123456',
                       charset='utf8',
                       db='tes1t')

# 关闭连接
conn.close()
